<?
include 'functions.php';
$torrent_data = bdec(file_get_contents('Duke.torrent'));
$info = strtolower(sha1(benc($torrent_data['info'])));
$scrape = str_replace('announce', 'scrape', $torrent_data['announce']);
$sources = bdec(@file_get_contents($scrape . '?info_hash=' . urlencode(hex2bin($info))));

if ($c > 1) {
for ($i = 0; $i < $c; $i++) {
echo $torrent_data['info']['files'][$i]['path']['0'] . " (" . round((($torrent_data['info']['files'][$i]['length'])/1048576),2) . " MB) ";
}
} else {
echo $torrent_data['info']['name'] . " (" . round((($torrent_data['info']['length'])/1048576),2) . " MB) ";
}
?>
